package net.cloudcodex.client.home.view;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import net.cloudcodex.client.home.view.HomeView.Message;
import net.cloudcodex.client.home.view.panel.campaign.HomeCampaignPanel;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.inject.Inject;

/**
 * 
 * 
 * @author ADaroussin
 */
public class HomeCampaignViewImpl extends FlowPanel implements HomeCampaignView {

	private final Message message;

	private final HomeCampaignPanel homeCampaignPanel;

	@Inject
	public HomeCampaignViewImpl(Message message) {
		this.message = message;
		homeCampaignPanel = new HomeCampaignPanel();
		homeCampaignPanel.setMessage(message);
		this.add(homeCampaignPanel);
	}

	@Override
	public void addCampaigns(long id, String icon, String name) {
		homeCampaignPanel.addCampaign(id, icon, name);	
	}

	@Override
	public void addCampaignInfos(Date creationDate,
			List<String> activeCharacters) {
		homeCampaignPanel.addCampaignInfos( creationDate,
				activeCharacters);
	}

	@Override
	public void addNotification(String message, Date date) {
		homeCampaignPanel.addNotification(message, date);
	}

	@Override
	public void addStoryBoardResponse(ArrayList<String> charactersResponder) {
		homeCampaignPanel.addStoryBoardResponse(charactersResponder);
	}

	@Override
	public HasClickHandlers getCampaignAvatar() {
		
		return homeCampaignPanel.getCampaignAvatar();
	}

	@Override
	public HasClickHandlers getSeeMoreAnchor() {
		// TODO Auto-generated method stub
		return homeCampaignPanel.getSeeMoreAnchor();
	}
	
	@Override
	public void initView() {
		homeCampaignPanel.initComponent();
		
	}


	
}
